public class Test {
    public static void main(String[] args) {
        int n=7;
        int i=2;
        for ( i = 2; i <= Math.sqrt(n); i++) {
            if(n%i==0){
                System.out.println(n+"是合数");
                break;
            }
        }
        if (i>Math.sqrt(n))
        {
            System.out.println(n+"是素数");
        }
    }
}
